import 'package:fish_redux/fish_redux.dart';
import 'package:wowhy/models/admin_user_info.dart';

import 'state.dart';

enum AdminUserListAction {
  init,
  onSearch,
  search,
  onRefresh,
  refresh,
  onFetch,
  fetch,
  onAdd,
  add,
  remove,
}

class AdminUserListActionCreator {
  static Action init() {
    return Action(AdminUserListAction.init);
  }

  static Action onSearch() {
    return Action(AdminUserListAction.onSearch);
  }

  static Action search(String query) {
    return Action(AdminUserListAction.search, payload: query);
  }

  static Action onRefresh() {
    return Action(AdminUserListAction.onRefresh);
  }

  static Action refresh(AdminUserListState state) {
    return Action(AdminUserListAction.refresh, payload: state);
  }

  static Action onFetch() {
    return Action(AdminUserListAction.onFetch);
  }

  static Action fetch(AdminUserListState state) {
    return Action(AdminUserListAction.fetch, payload: state);
  }

  static Action onAdd() {
    return Action(AdminUserListAction.onAdd);
  }

  static Action add(AdminUserInfo state) {
    return Action(AdminUserListAction.add, payload: state);
  }

  static Action remove(AdminUserInfo payload) {
    return Action(AdminUserListAction.remove, payload: payload);
  }
}
